package extras.src.org.eclipse.persistence.jpa.example.inventory.tools;

import java.sql.Date;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import entity.Customer;

public class Populator {
    public static void main(String args[]){
	System.out.println("Test Populator");
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1", new java.util.HashMap());
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        Populator.populate(em);
        em.getTransaction().commit();
        em.close();
        emf.close();
    }

    public static void populate(EntityManager em) {
	
	Customer customer = new Customer();

	customer.setId(3);
	customer.setName("Ris :)");

	em.persist(customer);
	}
}
